package com.freewater.springboot.demo.ioc.lookupmethodinject.scopedproxy;

import com.freewater.springboot.demo.ioc.lookupmethodinject.Command;

public class CommandManager {

    private CommandFactory commandFactory;

    public void setCommandFactory(CommandFactory commandFactory) {
        this.commandFactory = commandFactory;
    }

    public void process(Object commandState) {
        final Command command = this.commandFactory.getCommand();
        command.setState(commandState);
        command.execute();
    }
}
